package cn.laixueit;

import cn.laixueit.service.UserServiceInterface;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext.xml"})
public class DemoTestDemo {

//    @Test
//    public void t(){
//        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
//        UserController userController1 = context.getBean("userController", UserController.class);
//        UserController userController2 = context.getBean("userController", UserController.class);
//        System.out.println(userController1 == userController2);
//        userController1.add();
//        userController2.add();


//        context.destroy();

//    }

//    @Autowired
//    private UserController userController;

    @Autowired
    private UserServiceInterface userServiceInterface;

    @Test
    public void t2(){
        userServiceInterface.add();
    }
}
